//
//  ShellMineViewController.m
//  ShellWallert
//
//  Created by lvzhao on 2019/5/13.
//  Copyright © 2019 吕VV. All rights reserved.
//

#import "ShellMineViewController.h"
#import "ShellMineView.h"
#import "ShellMineViewModel.h"

@interface ShellMineViewController ()

@property (nonatomic,strong) ShellMineView *mineView;

@property (nonatomic,strong) ShellMineViewModel *viewModel;


@end

@implementation ShellMineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
    @weakify(self);
    [[[NSNotificationCenter defaultCenter] rac_addObserverForName:k_APPLanguageWillChangeNotificationName object:nil] subscribeNext:^(NSNotification * _Nullable x) {
        @strongify(self);
        self.title = LZLocalizedString(@"我的");
    }];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.barTintColor = COLOR_TINT;
    //通知消息
    [self.viewModel getUserNotification];
    [self.viewModel getLevelInfo];
}


#pragma mark - setupUI
- (void)setupUI{
    [self.view addSubview:self.mineView];
    [self.mineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

#pragma mark - actions

#pragma mark - custool

#pragma mark - get && set
- (ShellMineView *)mineView{
    
    if(!_mineView){
        _mineView = [[ShellMineView alloc] initViewModel:self.viewModel];
    }
    return _mineView;
}

- (ShellMineViewModel *)viewModel{
    if(!_viewModel){
        _viewModel = [[ShellMineViewModel alloc] init];
    }
    return _viewModel;
}



@end
